home *** CD-ROM | disk | FTP | other *** search
- Path: ias_ppp0105.iamerica.net!72274.264
- From: 72274.264@compuserve.com (Sergey Kurtsev)
- Newsgroups: comp.lang.c++
- Subject: Re: Converting Numbers to English
- Date: Wed, 24 Jan 1996 05:43:25 -0500
- Organization: Hello, all.
- Message-ID: <72274.264.7.003ABDA6@compuserve.com>
- References: <4e0pii$grt@mother.usf.edu>
- NNTP-Posting-Host: ias_ppp0105.iamerica.net
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev B]
-
- In article <4e0pii$grt@mother.usf.edu> oneal@suntan.eng.usf.edu (Aaron Oneal) writes:
-
- > Hi all. I need some kind of algorithm to convert a number like
- >240,353,740.23 to English (two hundred forty million, three hundred
- >fifty-three thousand, seven hundred forty and twenty-three
- >hundredths). I don't really need code, although it certainly couldn't
- >hurt. I just need a point in the right direction.
- > Aaron
-
-
- Starting from period and going in left direction separate number in groups
- of 3 digits and write in words 1st digit of 1st group (add "hundred" if
- necessary) then 2nd and 3rd in words. Then continue with 2nd group and etc.
- After period just write using algorithm of the 1st part and add what type
- (tenth, hundredth, etc.)
-
- Hope it's not very scary ?-)
-
- Good luck
-